package com.module.TraceSource.util;

import java.util.HashMap;
import java.util.Map;

/**
 * 溯源组件处理工具类
 * @author wult
 * @Date Dec 30, 2011
 */
public class ReturnUtil {

	
	/**
	 * 操作处理返回
	 * @param isTrue
	 * @return
	 */
	public static Map<String, Object> optHandle(boolean isTrue){
		String status = null;
		status = (isTrue == true ? "操作成功！": "操作失败！");
		return  optHandle(isTrue,status);
	}
	
	/**
	 * 操作处理返回
	 * @param isTrue
	 * @return
	 */
	public static Map<String, Object> optHandle(boolean isTrue,String message){
		Map<String, Object> statusMap = new HashMap<String, Object>();
		statusMap.put("state", isTrue);	
		statusMap.put("msg", message);
		return  statusMap;
	}
	
	public static Map<String,Object> optCodeErrorHandle(String str){
		Map<String, Object> statusMap = new HashMap<String, Object>();
		statusMap.put("hint", str);
		return  statusMap;
	}
}
